/**
 * Created with IntelliJ IDEA.
 * Description:
 * user:likai
 * Date:2022-10-08
 * Time:19:24
 */
public class Test {
    public static void main1(String[] args) {
        String s1 = "asd";
        String s2 = "asd";
        String s3 = new String("asd");
        String s4 = new String("asd");
        System.out.println(s1 == s2);
        System.out.println(s1 == s3);
        System.out.println(s3 == s4);
    }

    public static void main2(String[] args) {
        char[] chars={'a','b','c'};
        String string1=new String(chars);
        string1.intern();
        String string2="abc";
        System.out.println(string2 == string1);
    }

    public static void main(String[] args) {
        StringBuffer sb=new StringBuffer("abc");
        sb.replace(0,2,"x");
        //String string =sb;
        String string= sb.toString();
        System.out.println(sb);
    }
}
